/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.brain.core.dto;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Transient;

/**
 * 
 * @author Lrivera
 */
@Entity
@Table(name = "TCORE_ENTIDAD")
public class EntidadDto extends ComunDto implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "SEQ_TCORE_ENTIDAD")
    @TableGenerator(name = "SEQ_TCORE_ENTIDAD", table = "TCORE_ENTIDAD", pkColumnName = "NOMBRE", valueColumnName = "CORRELATIVO", pkColumnValue = "TCORE_ENTIDAD", allocationSize = 1)
    private Long id;
    @Basic(optional = false)
    @Column(name = "NOMBRE")
    private String nombre;
    @Basic(optional = false)
    @Column(name = "CORRELATIVO")
    private Long correlativo;
    @Basic(optional = false)
    @Column(name = "BITACORA")
    private Boolean bitacora;
    @Transient
    private String bitacoraTexto;
    
    @Column(name="MODULO")
    private String modulo;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public Long getCorrelativo() {
        return correlativo;
    }

    public void setCorrelativo(Long correlativo) {
        this.correlativo = correlativo;
    }

    public Boolean getBitacora() {
        return bitacora;
    }

    public void setBitacora(Boolean bitacora) {
        this.bitacora = bitacora;
    }

    public String getBitacoraTexto() {
        return (this.bitacora == Boolean.TRUE ? "SI" : "NO");
    }

    public void setBitacoraTexto(String bitacoraTexto) {
        this.bitacoraTexto = bitacoraTexto;
    }

    public String getModulo() {
        return modulo;
    }

    public void setModulo(String modulo) {
        this.modulo = modulo;
    }


    
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EntidadDto)) {
            return false;
        }
        EntidadDto other = (EntidadDto) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.brain.core.dto.EntidadDto[ id=" + id + " ]";
    }
}
